<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { templates } from '@/utils/agreementText'

const title = ref('')
const content = ref('')

onLoad(({ type }) => {
  if (type === 'private') {
    title.value = '隐私条款'
    content.value = templates[0]
  }
  else if (type === 'user') {
    title.value = '用户协议'
    content.value = templates[1]
  }
})
</script>

<template>
  <view class="p-4 text-28">
    <nut-navbar :title="title" custom-color="#000" left-show placeholder fixed />
    <rich-text :nodes="content" />
  </view>
</template>
